package com.gpStudy.design.proxy.JDKDynamicProxy;

import com.gpStudy.design.proxy.Iuser;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

public class UserProxyTest {
    public static void main(String[] args) {
        InvocationHandler invocationHandler = new DynamicUserProxy(new DynamicUserImpl());

        Iuser iuser = (Iuser)Proxy.newProxyInstance(invocationHandler.getClass().getClassLoader(), new Class[]{Iuser.class}, invocationHandler);
        iuser.eat("土");
    }
}
